
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>剪贴板的使用 · Summary</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-back-to-top-button/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-code/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-splitter/splitter.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search-pro/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-insert-logo/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-pageview-count/plugin.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-tbfed-pagefooter/footer.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-prism/prism-xonokai.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    <link rel="next" href="指定入参的使用.html" />
    
    
    <link rel="prev" href="关于Xcode12静态库打包的一些心得.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                        <b>1.1.</b>
                    
                    介绍
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2" data-path="../workflows/">
            
                <a href="../workflows/">
            
                    
                        <b>1.2.</b>
                    
                    workflows相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.2.1" data-path="../workflows/iOS开发如何给自己的App增加捷径自定义拓展.html">
            
                <a href="../workflows/iOS开发如何给自己的App增加捷径自定义拓展.html">
            
                    
                        <b>1.2.1.</b>
                    
                    iOS开发如何给自己的App增加捷径自定义拓展
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.2.2" data-path="../workflows/如何制作一个手机上的Github图床捷径workflow.html">
            
                <a href="../workflows/如何制作一个手机上的Github图床捷径workflow.html">
            
                    
                        <b>1.2.2.</b>
                    
                    如何制作一个手机上的Github图床捷径(workflow)
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.3" data-path="../AppleScript/">
            
                <a href="../AppleScript/">
            
                    
                        <b>1.3.</b>
                    
                    AppleScript相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.3.1" data-path="../AppleScript/关于AppleScript脚本语言的一些使用总结.html">
            
                <a href="../AppleScript/关于AppleScript脚本语言的一些使用总结.html">
            
                    
                        <b>1.3.1.</b>
                    
                    关于AppleScript脚本语言的一些使用总结
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.2" data-path="../AppleScript/为Mac自带的AppleScript脚本编辑器增加代码注释快捷键.html">
            
                <a href="../AppleScript/为Mac自带的AppleScript脚本编辑器增加代码注释快捷键.html">
            
                    
                        <b>1.3.2.</b>
                    
                    为Mac自带的AppleScript脚本编辑器增加代码注释快捷键
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.3.3" data-path="../AppleScript/say指令让Mac说话.html">
            
                <a href="../AppleScript/say指令让Mac说话.html">
            
                    
                        <b>1.3.3.</b>
                    
                    say指令让Mac开口说话
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.4" data-path="./">
            
                <a href="./">
            
                    
                        <b>1.4.</b>
                    
                    Shell相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.4.1" data-path="我折腾的shell笔记.html">
            
                <a href="我折腾的shell笔记.html">
            
                    
                        <b>1.4.1.</b>
                    
                    我折腾的shell笔记
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.2" data-path="关于Xcode12静态库打包的一些心得.html">
            
                <a href="关于Xcode12静态库打包的一些心得.html">
            
                    
                        <b>1.4.2.</b>
                    
                    关于Xcode12静态库打包的一些心得
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.4.3" data-path="剪贴板的使用.html">
            
                <a href="剪贴板的使用.html">
            
                    
                        <b>1.4.3.</b>
                    
                    剪贴板的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.4.4" data-path="指定入参的使用.html">
            
                <a href="指定入参的使用.html">
            
                    
                        <b>1.4.4.</b>
                    
                    指定入参的使用
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    
        <li class="chapter " data-level="1.5" data-path="../git-about/">
            
                <a href="../git-about/">
            
                    
                        <b>1.5.</b>
                    
                    git相关
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.5.1" data-path="../git-about/git使用技巧总结.html">
            
                <a href="../git-about/git使用技巧总结.html">
            
                    
                        <b>1.5.1.</b>
                    
                    git使用技巧总结
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >剪贴板的使用</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h1 id="&#x526A;&#x8D34;&#x677F;&#x7684;&#x4F7F;&#x7528;">&#x526A;&#x8D34;&#x677F;&#x7684;&#x4F7F;&#x7528;</h1>
<p><strong>&#x8BBE;&#x7F6E;&#x526A;&#x8D34;&#x677F; &#x5199;&#x4E86;&#x4E24;&#x4E2A;Alfred &#x82F1;&#x6587;&#x8F6C;&#x5927;&#x5C0F;&#x5199; &#x5C06;&#x7ED3;&#x679C;&#x62F7;&#x8D1D;&#x81F3;&#x526A;&#x8D34;&#x677F; &#x8282;&#x7701;&#x65F6;&#x95F4;&#x63D0;&#x5347;&#x6548;&#x7387;</strong></p>
<pre class="language-"><code class="lang-bash">osascript -e <span class="token string">&apos;set the clipboard to &quot;&apos;</span>&quot;<span class="token variable">${*}</span><span class="token string">&quot;&apos;&quot;</span> as text&apos;
</code></pre>
<p><strong>&#x83B7;&#x53D6;&#x526A;&#x8D34;&#x677F;&#x5185;&#x5BB9;</strong></p>
<pre class="language-"><code class="lang-bash"><span class="token variable"><span class="token variable">$(</span>osascript -e <span class="token string">&quot;get the clipboard as &#xAB;class utf8&#xBB;&quot;</span> <span class="token operator">|</span> <span class="token function">sed</span> <span class="token string">&quot;s/utf8&#xBB;//; s/&#xBB;//&quot;</span><span class="token variable">)</span></span>
</code></pre>
<p><strong>Shell&#x64CD;&#x4F5C;&#x526A;&#x8D34;&#x677F;</strong></p>
<pre class="language-"><code class="lang-bash"><span class="token function">ls</span> <span class="token operator">|</span> pbcopy  <span class="token comment">#&#x628A;ls&#x5185;&#x5BB9;&#x62F7;&#x8D1D;&#x5230;&#x526A;&#x8D34;&#x677F; | &#x7B26;&#x53F7;&#x76F8;&#x5F53;&#x4E8E;then &#x8D77;&#x5230;&#x4E00;&#x4E2A;&#x627F;&#x524D;&#x542F;&#x540E;&#x63A5;&#x7740;&#x5E72;&#x7684;&#x4F5C;&#x7528; &#x7BA1;&#x9053;&#x7684;&#x610F;&#x601D;</span>
<span class="token builtin class-name">echo</span> <span class="token string">&quot;xxxxx&quot;</span> <span class="token operator">|</span> pbcopy <span class="token comment">#&#x62F7;&#x8D1D;echo&#x7684;&#x5185;&#x5BB9;</span>
<span class="token function">du</span> -sh * <span class="token operator">|</span> pbcopy <span class="token comment">#&#x628A;&#x5F53;&#x524D;&#x76EE;&#x5F55;&#x7684;&#x78C1;&#x76D8;&#x5360;&#x7528;&#x60C5;&#x51B5;&#x62F7;&#x8D1D;&#x81F3;&#x526A;&#x8D34;&#x677F;</span>
pbcopy <span class="token operator">&lt;</span> README.md <span class="token comment"># &#x6587;&#x4EF6;&#x5185;&#x5BB9;&#x62F7;&#x8D1D;&#x81F3;&#x526A;&#x8D34;&#x677F;</span>
pbpaste <span class="token operator">&gt;</span> file.txt <span class="token comment">#&#x83B7;&#x53D6;&#x526A;&#x8D34;&#x677F;&#x5185;&#x5BB9;&#x5E76;&#x5199;&#x5165;&#x5230;&#x6587;&#x4EF6;</span>
</code></pre>
<p><strong>&#x91CD;&#x5B9A;&#x5411;&gt;&gt;,&gt;&gt;,&gt;,&lt;&#x7B49;&#x7B26;&#x53F7;&#x7684;&#x4F7F;&#x7528;</strong></p>
<pre class="language-"><code class="lang-bash"><span class="token function">cat</span> ./test.txt <span class="token operator">&gt;&gt;</span> ./text.txt <span class="token comment">#&#x8FFD;&#x52A0;&#x5199;&#x5165;text.txt&#x6587;&#x4EF6;</span>
<span class="token function">cat</span> ./test.txt <span class="token operator">&gt;</span> ./text.txt <span class="token comment">#&#x8986;&#x76D6;&#x5199;&#x5165;text.txt&#x6587;&#x4EF6;</span>
<span class="token comment"># &lt;&lt; &#x548C; &lt; &#x610F;&#x601D;&#x5DEE;&#x4E0D;&#x591A; &#x4ECE;&#x6587;&#x4EF6;&#x4E2D;&#x8BFB;&#x53D6;&#x8F93;&#x5165;</span>
<span class="token function">cat</span> <span class="token operator">&lt;</span> ./hello.txt <span class="token comment">#&#x8BFB;&#x53D6;&#x6587;&#x4EF6;&#x5185;&#x5BB9;</span>
<span class="token comment">#&#x6267;&#x884C;applescript &#x83B7;&#x53D6;&#x6307;&#x4EE4;&#x5757;</span>
osascript <span class="token operator">&lt;&lt;</span><span class="token string">EOF
 &#x591A;&#x884C;&#x811A;&#x672C;&#x6307;&#x4EE4;
EOF</span>
<span class="token comment">#&#x8BFB;&#x53D6;hello.txt&#x5E76;&#x8FFD;&#x52A0;&#x5185;&#x5BB9;`today is beautiful day`</span>
<span class="token function">cat</span> <span class="token operator">&lt;&lt;</span><span class="token string">EOF<span class="token bash punctuation"> <span class="token operator">&gt;&gt;</span> ./hello.txt</span>
today is beautiful a day
EOF</span>

<span class="token comment">#&#x4ECE;passwd.txt&#x8BFB;&#x53D6;&#x5BC6;&#x7801; &#x5E76;&#x4FEE;&#x6539;root&#x5BC6;&#x7801;</span>
<span class="token function">passwd</span>  --stdin root  <span class="token operator">&lt;</span> passwd.txt
<span class="token comment"># &lt;&lt;&lt; &#x6807;&#x51C6;&#x8F93;&#x5165;&#x7684;&#x5B57;&#x7B26;&#x4E32;</span>
<span class="token comment"># echo &quot;123456&quot; | passwd  --stdin  root</span>
<span class="token function">passwd</span> --stdin root  <span class="token operator">&lt;&lt;&lt;</span> <span class="token string">&quot;123456&quot;</span>
</code></pre>
<p><strong>echo ${*}&#x4F1A;&#x9010;&#x4E2A;&#x53C2;&#x6570;&#x7528;&#x7A7A;&#x683C;&#x62FC;&#x8D77;&#x6765; rar&#x538B;&#x7F29;&#x7684;&#x65F6;&#x5019;&#x5C31;&#x662F;&#x8FD9;&#x6837;&#x64CD;&#x4F5C;&#x7684;</strong> </p>
<p><code>rar a new.rar file1 file2 file3 ...</code><br><code>workflow</code>&#x91CC;&#x7684;<code>shell</code>&#x5165;&#x53C2; 
<code>${*}</code>&#x5219;&#x4F1A;&#x5217;&#x4E3E;&#x51FA;&#x6240;&#x6709;&#x7684;&#x8DEF;&#x5F84;, 
&#x5373;<code>rar a new.rar ${*}</code> &#x8981;&#x52A0;&#x5927;&#x62EC;&#x53F7; &#x4E0D;&#x7136;&#x4F1A;&#x62A5;&#x9519;</p>
<h3 id="&#x53C2;&#x8003;">&#x53C2;&#x8003;:</h3>
<ul>
<li><a href="https://www.runoob.com/linux/linux-shell-io-redirections.html" target="_blank"> runoob&#x83DC;&#x9E1F;&#x6559;&#x7A0B;</a></li>
<li><a href="https://www.jianshu.com/p/41c304016185" target="_blank">&#x3010;&#x63CF;&#x8FF0;&#x7B26;&#x3011;Shell&#x4E2D; 1&gt;&amp;2 2&gt;&amp;1 &amp;&gt; &#x91CD;&#x5B9A;&#x5411;&#x7684;&#x542B;&#x4E49;&#x548C;&#x533A;&#x522B;&#x662F;&#x4EC0;&#x4E48;&#xFF1F;</a></li>
<li><a href="https://www.jianshu.com/p/70136d731ca0" target="_blank">&#x3010;shell&#x3011;&#x600E;&#x4E48;&#x7406;&#x89E3;shell&#x4E2D;&#x7684; &quot;&lt;&quot; &#x3001; &quot;&lt;&lt;&quot; &#x3001; &quot;&lt; &lt;&quot; &#x3001;&quot;&lt;&lt;&lt;&quot; &#x7684;&#x542B;&#x4E49;&#xFF1F;</a><hr><div id="vcomments"></div><script src="//unpkg.com/valine/dist/Valine.min.js"></script><script>new Valine({el: "#vcomments",appId: 'oT5vWHkWT1JN1o5aXiSqYGtH-gzGzoHsz',appKey: 'V7zBLpzBgxVESicbyF072Cj9',placeholder: 'Just go go',avatar: '',meta: undefined,pageSize: 10,lang: 'zh-CN',recordIP: false})</script> </li>
</ul>
<footer class="page-footer"><span class="copyright">CoderWGB all right reserved&#xFF0C;powered by Gitbook</span><span class="footer-modification">&#x8BE5;&#x6587;&#x7AE0;&#x4FEE;&#x8BA2;&#x65F6;&#x95F4;&#xFF1A;
2021-01-31 17:44:57
</span></footer>
<script>console.log("plugin-popup....");document.onclick = function(e){ e.target.tagName === "IMG" && window.open(e.target.src,e.target.src)}</script><style>img{cursor:pointer}</style>
                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="关于Xcode12静态库打包的一些心得.html" class="navigation navigation-prev " aria-label="Previous page: 关于Xcode12静态库打包的一些心得">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
                <a href="指定入参的使用.html" class="navigation navigation-next " aria-label="Next page: 指定入参的使用">
                    <i class="fa fa-angle-right"></i>
                </a>
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"剪贴板的使用","level":"1.4.3","depth":2,"next":{"title":"指定入参的使用","level":"1.4.4","depth":2,"path":"books/Shell/指定入参的使用.md","ref":"./books/Shell/指定入参的使用.md","articles":[]},"previous":{"title":"关于Xcode12静态库打包的一些心得","level":"1.4.2","depth":2,"path":"books/Shell/关于Xcode12静态库打包的一些心得.md","ref":"./books/Shell/关于Xcode12静态库打包的一些心得.md","articles":[]},"dir":"ltr"},"config":{"plugins":["back-to-top-button","chapter-fold","code","copy-code-button","splitter","valine","-lunr","-search","search-pro","insert-logo","custom-favicon","pageview-count","tbfed-pagefooter","popup","-sharing","sharing-plus","-highlight","prism","prism-themes","simple-page-toc"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"tbfed-pagefooter":{"copyright":"CoderWGB","modify_label":"该文章修订时间：","modify_format":"YYYY-MM-DD HH:mm:ss"},"chapter-fold":{},"prism":{"css":["prism-themes/themes/prism-xonokai.css"]},"simple-page-toc":{"maxDepth":3,"skipFirstH1":true},"splitter":{},"search-pro":{},"sharing-plus":{"qq":false,"all":["facebook","google","twitter","instapaper","linkedin","pocket","stumbleupon"],"douban":false,"facebook":true,"weibo":false,"instapaper":false,"whatsapp":false,"hatenaBookmark":false,"twitter":true,"messenger":false,"line":false,"vk":false,"pocket":true,"google":false,"viber":false,"stumbleupon":false,"qzone":false,"linkedin":false},"popup":{},"code":{"copyButtons":true},"fontsettings":{"theme":"white","family":"sans","size":2},"favicon":"./logo.ico","back-to-top-button":{},"pageview-count":{},"prism-themes":{},"custom-favicon":{},"copy-code-button":{},"sharing":{"qq":true,"all":["douban","facebook","google","instapaper","linkedin","twitter","weibo","messenger","qq","qzone","viber","whatsapp"],"douban":true,"facebook":true,"weibo":true,"twitter":true,"pocket":true,"google":true,"qzone":true},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":true},"insert-logo":{"style":"background: none; max-height: 30px; min-height: 30px","url":"https://cdn.jsdelivr.net/gh/WangGuibin/MyFilesRepo/images/20210130164238.png"},"valine":{"avatar":"","lang":"zh-CN","pageSize":10,"placeholder":"Just go go","recordIP":false,"appId":"oT5vWHkWT1JN1o5aXiSqYGtH-gzGzoHsz","appKey":"V7zBLpzBgxVESicbyF072Cj9"}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"Summary","gitbook":"*"},"file":{"path":"books/Shell/剪贴板的使用.md","mtime":"2021-01-31T09:44:57.629Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2021-01-31T13:01:17.483Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-back-to-top-button/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-chapter-fold/chapter-fold.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-code/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-copy-code-button/toggle.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-splitter/splitter.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/jquery.mark.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search-pro/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-insert-logo/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-pageview-count/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing-plus/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

